import React, { Component } from 'react';
//子组件如何不使用withRouter 路由参数就拿不到
import {withRouter} from  'react-router-dom'
class gjzjwr extends Component {
  constructor(props) {
    super(props);
    this.state = {  }
  }
  render() { 
    console.log(this.props.location)
    return ( 
      <div>
        <div>我是高阶组件withRouter</div>
        <div>路由参数：{this.props.match?this.props.match.params.id:this.props.match}</div>
      </div>
    );
  }
}
 
// export default gjzjwr;
export default withRouter(gjzjwr);